#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int remove(int* nums, int numsSize) {
    int src = 1;
    int det = 0;
    while (src < numsSize) {
        if (nums[src] != nums[det]){
            det++;
            nums[det] = nums[src];
            //src++;

            //nums[++det] = nums[src++];
        }
        else {
            src++;
        }
    }
    return det + 1;
}
int main() {
	int arr[] = { -1,0,1,2,2,3,3,4,4,5, };
	int len = sizeof(arr) / sizeof(int);
	int ref = remove(arr, len);
	for (int i = 0; i < ref; i++) {
		printf("%d ", arr[i]);
	}
	return 0;
}